<?php
// +----------------------------------------------------------------------
// | Author: fl 365581323@qq.com
// +----------------------------------------------------------------------
namespace app\index\controller;
use think\Controller;
use think\Request;
use think\Db;
class Common extends Controller{
    // Request实例
    // protected $request;
	// function accesstoken(){ 
 //          $token=Db::name('token')->where("id=1")->find();
 //          if($token['addtime']<time()){
 //             $curl="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxa3d174a652481367&secret=97f0ef8df3a43892aec5f95490b016a4";
 //              $cate = json_decode(file_get_contents($curl),true);
 //              var_dump($cate);die;
 //              $data['access_token']=$cate['access_token'];
 //              $data['addtime']=time()+7200;
 //              $access=Db::name('token')->where("id=1")->save($data);
 //                return $access['access_token'];
 //          }else{
 //                return $token['access_token'];
 //      }
 //     }
	
}